//
// Created by shiminli on 2024/1/3.
//

#ifndef DDOFFICE_REGISTERS_H
#define DDOFFICE_REGISTERS_H

#include <iostream>
#include "../SQLHelper.h"
#include <mysql/mysql.h>



using namespace std;
using namespace ddoffice;
/**
CREATE TABLE `registers` (
  `user_id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `device_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `platform` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `account_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mode` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `create_time` datetime(3) DEFAULT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5635818456 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 */
#define RegistersTabName "registers";
struct Registers {
    long user_id;
    string device_id;
    string ip;
    string platform;
    string account_type;
    string mode;
    string create_time;
};
struct RegistersColumnName {
    const string tabName = "registers";
    const string user_id = "user_id";
    const string device_id = "device_id";
    const string ip= "ip";
    const string platform= "platform";
    const string account_type= "account_type";
    const string mode= "mode";
    const string create_time= "create_time";
};

class registers {
public:
    static RegistersColumnName names;


    static long insert(Registers &data);

    int update();

    vector<Registers> queryAll();

    Registers queryById(string user_id);


private:

};



#endif //DDOFFICE_REGISTERS_H
